package com.hand.pp.controller;/**
 * @author Estelle@앙수청
 * @date 2019/7/16 20:01
 */

import com.hand.pp.domain.Role;
import com.hand.pp.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 *  @author Estelle@앙수청
 *  @date 2019/7/16 19:47
 */
@RestController
@RequestMapping(value = "/role")
public class RoleController {

    @Autowired
    private RoleService roleService;

    @GetMapping
    public List<Role> getAllRole(){
        return roleService.queryAllRole();
    }

    @PutMapping
    public Long addRole(){
        return roleService.insertRole();
    }

    @PostMapping
    public void updateRole(){
        roleService.updateRole();
    }

    @DeleteMapping(value = "/{id}")
    public void deleteRole(@PathVariable("id") Long id){
        roleService.deleteRole(id);
    }
}
